import { _decorator, Component, director, Director, Node, UIOpacity, Widget } from 'cc';
const { ccclass, property, menu } = _decorator;

@ccclass('ViewAnimBase')
@menu('ViewAnim/ViewAnimBase')
export default abstract class ViewAnimBase extends Component {

    protected _inited: boolean = false;
    
    protected __preload(): void {
        this._inited = false;

        let widget = this.getComponent( Widget );
        if( widget) {
            widget.updateAlignment();
            widget.enabled = widget.alignMode == Widget.AlignMode.ALWAYS;
        }
        this.initialize();
    }

    abstract initialize(): void;
    abstract runInAction( duration: number ): void;
    abstract runOutAction( duration: number ): void;
}


